// pages/my-class-merchant/my-class-merchant.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
array:[],
array0:[],
index:0,
index0:0,
list:[],
list_teacher:[],
list_class:[],
choose_list: [],
dialog: !1,
  },
  list:function(res){
    console.log(res)
    // console.log(res.currentTarget.dataset.sccd_id)
    var id=res.currentTarget.dataset.class_id;
    wx.navigateTo({
      url: '/pages/my-class-merchant-list/my-class-merchant-list?class_id=' + id,
    })
  },

teacher:function(){
  getApp().request({
    url: getApp().api.schoolclass.teacher_list,
    success: (result) => {
      console.log(result.data)
      this.array=result.data;
      console.log(this.array)
      this.setData({
      array0:this.array,
      })
    },
  })
},

  class:function(e){
      getApp().request({
        url: getApp().api.schoolclass.store_class_type,
        success: (result) => {
          console.log(result.data.list)
          this.array=result.data.list;
          console.log(this.array)
          this.setData({
          array:this.array,
          })
        },
        
      })
      // console.log(this.array)
  },

  bindChange: function (a) {
    var t = a.detail.value[0];
    this.setData({
      newIndex: t
    });
  },
 

  bindPickerChange: function (e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    this.setData({
      index: e.detail.value,

    })
  },
  bindteacher: function (e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    this.setData({
      index0: e.detail.value
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (t) {





    
    getApp().page.onLoad(this, t);
    if (this.data.store.is_shenhe == 0) {
      wx.setNavigationBarTitle({
        title: '我的课程'
      })
    }
    getApp().request({
      url: getApp().api.schoolclass.store_class,
      success: (result) => {
        console.log(result.data.list)
        // this.array=result.data.list;
        this.setData({
        list_class:result.data.list,
        
        })
      },
      
    })
   
      
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})




